<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
  
  // var arr = [1, 2, 3, 4, 5, 6, 7, 8];
  //   var arr2 = arr.filter((item, index) => {
  //       return item > 5 
  //   });
  //   console.log(arr2); // 返回值 [6, 7, 8]
  
  function reverse1(ary) {
    var ary1=[]
      for(var i=0;i<ary.length;i++){//一层循环即可
        ary1[ary.length-1-i]=ary[i]
      }
      var num1=ary1[0]
      for(var i=0;i<ary1.length;i++){
       
      }
      ary1.sort()//冒泡排序
      var temp
      for(var i=0;i<ary1.length-1;i++){
        for(var j=0;j<ary1.length-1-i;j++){
          if(ary[i]>ary1[i+1]){
            
          }
        }
      }
      return  ary1.sort()
  }
  var ary2=[1,4,2,6,3,9]
  console.log( reverse1(ary2))
 
  </script>
</body>
</html>